package com.finna.tenant.dto.AccountDTO;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 账号及其所属租户列表响应
 */
@Data
public class AccountWithTenantsResponse {
    
    private Long id;
    
    private String accountName;
    
    private String accountAvatar;
    
    private String email;
    
    private Integer tenantCount;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    
    /**
     * 租户列表
     */
    private List<TenantForAccount> tenants;
    
    @Data
    public static class TenantForAccount {
        private Long tenantId;
        private String tenantName;
        private String tenantAvatar;
        private Boolean isPublic;
        private Long roleId;
        private String roleName;
        private String role;
        
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime joinedAt;
    }
}

